package rpc.proxy.staticproxy;

import rpc.proxy.SmsService;

/**
 * @ClassName: SmsProxy
 * @Description:
 * @author: Kowk
 * @since:1.0.0
 */
public class SmsProxy implements SmsService {

    private final SmsService smsService;

    public SmsProxy(SmsService smsService) {
        this.smsService = smsService;
    }

    @Override
    public String send(String message) {
        //在调用实际的方法之前，添加对应的操作
        System.out.println("发送之前添加任意操作");
        smsService.send(message);
        //在实际的方法运行结束后，还可以再次添加对应的操作
        System.out.println("发送完毕之后添加任意操作");
        return null;
    }
}
